﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class SiteMaster : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {

        string url = HttpContext.Current.Request.Path;
        string page = url.Substring(url.LastIndexOf("/") + 1);
      //  Console.Write(page);
        if (Session["role"] == null) Session["role"] = "普通用户"; 
        if (page.Contains("codelist") || page.Equals("recordlist.aspx"))
        {
            string s = Session["role"].ToString();
            if (s != "档案管理") Response.Redirect("noAuthority.aspx");
        }
        else if(page.Equals("adminlist.aspx"))
        {
            string s = Session["role"].ToString();
            if (s != "系统管理") Response.Redirect("noAuthority.aspx");
        }

        
       // script.Text = "<script type='text/javascript'>alert('您没有权限查看此页');</script>";
        //if (Int32.Parse(Session["role"].ToString()) != GetConfigurationSettings.SysAdmin)
        //{
        //    script.Text = "<script type='text/javascript'>alert('您没有权限查看此页');</script>";
        //    Response.Redirect("noAuthority.aspx");
        //}
    }
}
